package com.lin.cli;


import com.lin.cli.command.ConfigCommand;
import com.lin.cli.command.GenerateCommand;
import com.lin.cli.command.ListCommand;
import com.lin.cli.command.JsonGenerateCommand;
import picocli.CommandLine;
import picocli.CommandLine.Command;

import java.util.concurrent.Callable;

@Command(name = "generator", description = "生成acm代码", mixinStandardHelpOptions = true)
public class CommandExecutor implements Callable {

    private static CommandLine commandLine;
    {
        commandLine = new CommandLine(this)
                .addSubcommand(new GenerateCommand())
                .addSubcommand(new ConfigCommand())
                .addSubcommand(new ListCommand())
                .addSubcommand(new JsonGenerateCommand());
    }

    @Override
    public Object call() throws Exception {
        System.out.println("请输入命令,--help可以查看命令");
        return null;
    }

    public void doExecutor(String[] args) {
        commandLine.execute(args);
    }
}
